package com.ccll.time;

import org.junit.jupiter.api.Test;

import java.text.SimpleDateFormat;
import java.util.logging.SimpleFormatter;

/**
 * @author Seon
 * @date 2023/1/3 21:41
 */
public class TimeOperator {
    @Test
    public void recoverTime() {
        String dateformat = "yyyy-MM-dd HH-mm-ss";
        Long time = 1551001284509L;
        String format = new SimpleDateFormat(dateformat).format(time);
        System.out.println(format);
    }


    @Test
    public void computeFee() {
        System.out.println(778/3);
        int isHoliday = 0;
        int salary = 680;
        int sum = 0;
        for (int i = 12; i <= 31; i ++) {
            if (i >= 21 && i <= 24) {
                continue;
            }
            System.out.printf("当前是1月第%d天   ", i);
            System.out.println();
            isHoliday ++;
            if (isHoliday % 5 == 0) {
                System.out.println("发工资了，680元到账");
                sum += salary;
            }
        }

        for (int i = 1; i <= 15; i++) {
            System.out.printf("当前是2月第%d天   ", i);
            System.out.println();
            isHoliday ++;
            if (isHoliday % 5 == 0) {
                System.out.println("发工资了，680元到账");
                sum += salary;
            }
        }
        System.out.println("sum = " + sum);
    }
}
